#! /usr/bin/env python2.5

import commands
import os
import sys
import time

def pingTest(serverList):
    if not isinstance(serverList, list):
        if isinstance(serverList, str):
            serverList = [serverList]
        else:
            print 'Could not ping a server'
    #
    while True: #for ii in range(10):
        for server in serverList:
            resp = commands.getoutput('ping -c 1 %s' % server)
            if resp.split(' packets received')[0].split(', ')[-1] == '0':
                print '%s @ %s' % (server, time.strftime('%H:%M:%S'))
            time.sleep(1)

if __name__ == '__main__':
    pingTest(sys.argv[1:])
